"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const components_1 = require("@tarojs/components");
const taro_1 = require("@tarojs/taro");
const lodash_1 = require("lodash");
const react_1 = require("react");
const taro_ui_1 = require("taro-ui");
require("./person.scss");
const Person = () => {
    const [user, setUser] = react_1.useState();
    taro_1.useDidShow(() => {
        const user = taro_1.default.getStorageSync("userInfo");
        if (!lodash_1.isEmpty(user)) {
            setUser(user);
        }
    });
    const submit = (value) => {
        // 1.著作权人  2.代理人
        if (value === 1) {
            taro_1.default.navigateTo({
                url: "/pages/person/certification/certification?userType=" + value
            });
        }
    };
    // 实名认证页面跳转
    // const Certification=()=>{
    //   Taro.navigateTo({
    //     url: '/pages/person/certification/certification'
    //   })
    // }
    return (<components_1.View className="index">
      <components_1.View className="top">
        {lodash_1.isEmpty(user) ? (<taro_ui_1.AtAvatar circle text="游客"/>) : (<taro_ui_1.AtAvatar circle image={user.avatarUrl}/>)}
        <components_1.View style={{ width: '20px' }}/>
        {lodash_1.isEmpty(user) ? (<components_1.View className="at-article">游客</components_1.View>) : (<components_1.View>{user.nickName}</components_1.View>)}
        
      </components_1.View>
      <components_1.View className="center">
        <components_1.View className="center-item">
          <components_1.View>0</components_1.View>
          <components_1.View>我的作品</components_1.View>
        </components_1.View>
        <components_1.View className="center-item">
          <components_1.View>0</components_1.View>
          <components_1.View>我的登记</components_1.View>
        </components_1.View>
      </components_1.View>
      <taro_ui_1.AtList hasBorder={false}>
        <taro_ui_1.AtListItem title="实名认证" arrow="right" hasBorder={false} onClick={() => submit(1)}/>
        <taro_ui_1.AtListItem title="我的申请" arrow="right" hasBorder={false} onClick={() => submit(2)}/>
        <taro_ui_1.AtListItem title="我的购买" arrow="right" hasBorder={false} onClick={() => submit(3)}/>
      </taro_ui_1.AtList>
    </components_1.View>);
};
exports.default = Person;
//# sourceMappingURL=person.jsx.map